/**
 * 
 */
package com.lehecai.core.queue;

import com.lehecai.core.type.sms.SmsType;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Sunshow
 *
 */
public class QueueConstant {
	
	public static final String CALLBACK_PARAMETER_NAME = "leheqInfo";
	
	public static final String DATA_TYPE_DEFAULT = "json";
	
	public static final String SIMPLEQ_PARAM_TYPE = "type";
	public static final String SIMPLEQ_PARAM_DATA = "data";
	public static final String SIMPLEQ_PARAM_QUEUE = "queue";
	
	public static final String SIMPLEQ_TYPE_GET = "get";
	public static final String SIMPLEQ_TYPE_PUT = "put";
	
	public static final int RC_SUCCESS = 0;
	public static final int RC_FAILURE = -1;

	public static final int HTTP_TIME_OUT_DEFAULT = 30000;
	
	public static final String TASK_MAIL_DEFAULT = "10001";
	
	public static final String TASK_SMS_DEFAULT = "20001";// 默认,普通
	public static final String TASK_SMS_CODE = "20002";// 验证码
	public static final String TASK_SMS_INTERACTION = "20003";// 交互
	public static final String TASK_SMS_MARKETING = "20004";// 营销

    private static Map<SmsType,String> smsTypeTaskMap = new HashMap<SmsType,String>();

    static{
        smsTypeTaskMap.put(SmsType.NORMAL,TASK_SMS_DEFAULT);
        smsTypeTaskMap.put(SmsType.CODE,TASK_SMS_CODE);
        smsTypeTaskMap.put(SmsType.INTERACTION,TASK_SMS_INTERACTION);
        smsTypeTaskMap.put(SmsType.MARKETING,TASK_SMS_MARKETING);

    }

    /**
     * 根据短信类型获得短信任务类型
     * @param smsType
     * @return
     */
    public static String getSmsTaskTypeBySmsType(SmsType smsType){
        if(smsType == null){
            return null;
        }
        return smsTypeTaskMap.get(smsType);
    }
}
